<template>
  <view class="login-page">

    <view class="bg-logo">
      <view class="logo-content">
        <view class="logo-layout">
          <image src="/static/login.jpg" class="login-img"></image>
          <text class="website-address">https://gitee.com/Subtop</text>
        </view>
      </view>
    </view>
    <view class="login-layout">
      <view class="login-input">
        <text class="iconfont start-icon icon-weibiaoti--6"></text>
        <input
          class="uni-input"
          placeholder="请输入账号"
          v-model="username"
          placeholder-class="placeholder-style"
        />
        <text
          class="iconfont end-icon icon-weibiaoti--13"
          @click="clearUsername"
        ></text>
      </view>
      <view class="login-input">
        <text class="iconfont start-icon icon-weibiaoti--27"></text>
        <input
          class="uni-input"
          placeholder="请输入密码"
          :password="showPassword"
          v-model="password"
          placeholder-class="placeholder-style"
        />
        <text
          class="iconfont end-icon icon-weibiaoti--34"
          @click="showPassword = !showPassword"
        ></text>
      </view>

      <view class="login-button" @click="loginFn">登录</view>

      <view class="login-bottom">
        <text class="bottom-text">忘记密码</text>
        <text class="bottom-text">注册</text>
      </view>
    </view>
  </view>
</template>

<script>
import { defineComponent } from "vue";
import { useMixin } from "./mixins";
export default defineComponent({
  name: "login001",
  props: {},
  components: {},
  setup() {
    const mixin = useMixin();
    return {
      ...mixin,
    };
  },
});
</script>

<style lang="less" scoped>
.login-page {
  width: 100%;
  height: 100vh;
  background: #ffffff;
}
.bg-logo {
  background: #49c998;
  padding-top: 80rpx;
  box-sizing: border-box;
  height: 700rpx;

  .logo-content {
    height: calc(700rpx - 80rpx);
    display: flex;
    justify-content: center;
    align-items: center;
    .logo-layout {
      display: flex;
      flex-direction: column;
      align-items: center;
      .login-img {
        width: 180rpx;
        height: 180rpx;
        border-radius: 50%;
      }
      .website-address {
        color: #fff;
        margin-top: 20rpx;
      }
    }
  }
}
.login-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  .login-input {
    width: 600rpx;
    position: relative;
    margin-top: 70rpx;
    .uni-input {
      border-bottom: 1rpx solid #eeeeee;
      height: 80rpx;
      line-height: 80rpx;
      padding: 0 60rpx;
      box-sizing: border-box;
      //   placeholder样式修改
      .placeholder-style {
        color: #999;
        font-size: 24rpx;
      }
    }
    .start-icon {
      font-size: 40rpx;
      position: absolute;
      left: 0;
      color: #49c998;
      top: 50%;
      transform: translateY(-50%);
    }
    .end-icon {
      font-size: 30rpx;
      position: absolute;
      color: #999;
      right: 0;
      top: 50%;
      transform: translateY(-50%);
    }
  }
  .login-button {
    width: 600rpx;
    background: #49c998;
    height: 100rpx;
    line-height: 100rpx;
    text-align: center;
    border-radius: 50rpx;
    color: #fff;
    font-size: 30rpx;
    margin-top: 80rpx;
    transition: all 0.3s;
    &:active {
      background: #3c9c7c;
    }
  }
  .login-bottom {
    width: 580rpx;
    display: flex;
    justify-content: space-between;
    margin-top: 50rpx;
    .bottom-text {
      color: #999;
      font-size: 24rpx;
      &:active {
        color: #3c9c7c;
      }
    }
  }
}
</style>
